#get samples
#my_file="/Volumes/Data/switch_project/exp16/1000M/900M/1/1_flow_pure_delay_middle.txt";
#my_file="/Volumes/Data/switch_project/exp16/1000M/900M/1/1_flow_pure_delay_begin_middle.txt";

my_file="/Volumes/Data/switch_project/exp16/1000M/900M/1/1_flow_delay_loss_episode.txt";

my_2nd_file="/Volumes/Data/switch_project/exp16/1000M/900M/1/generated_output.txt";

X=scan(file=my_file);
W=scan(file=my_2nd_file);

lagMax=100;

#plot cdf
quartz();
plot(ecdf(X), col="red");
plot(ecdf(W), col="blue", add=TRUE);

#calculate autocor
X_acf=acf(X, lag.max=lagMax, type="correlation", plot=FALSE);
W_acf=acf(W, lag.max=lagMax, type="correlation", plot=FALSE);
print(X_acf);
print(W_acf);

quartz();
plot(X_acf$acf, col="red");
points(W_acf$acf, col="blue");

#plot seq
#quartz();
#plot(X, col="red");
#points(W, col="blue");